package d0316;

public class SecondException {
    public static void main(String[] args) {
        try {
            int x = 100;
            int y = 10;
            System.out.println("x/y + x / y");
            System.out.println("world");
        } catch (ArithmeticException ex) {
            System.out.println("发生数学异常，除数不能为零");
        } catch (NullPointerException ex) {
            System.out.println("发生了空指针异常");
        } catch (Exception e) {
            System.out.println("发生了异常");
        } finally {//无论程序是否发生异常，均会执行}
            System.out.println("程序运行结束");
        }
    }}
